﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Ajax.aspx.cs" Inherits="Ajax" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager runat="server" ID="scriptManager1" AllowCustomErrorsRedirect="False" AsyncPostBackErrorMessage="Hey, error" OnAsyncPostBackError="scriptManager1_AsyncPostBackError">
    </asp:ScriptManager>
    <asp:UpdateProgress runat="server" ID="updateProgress" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <div style="position: fixed; top: 10px; left: 48%; padding:5px; background-color: yellow; border: 1px solid black">
                Waiting...
            </div>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <div>
        <asp:Button runat="server" Text="Button 0" ID="button0" />
        <asp:Label ID="timerLiteral3" runat="server" ForeColor="Red"></asp:Label>
        <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">
            <ContentTemplate>
                Timer here!<asp:Timer ID="Timer1" runat="server" Enabled="false" Interval="3000">
                </asp:Timer>
                <asp:Panel runat="server" ID="panel1">
                    Update Panel 1<br />
                    <asp:Label ID="timerLiteral1" runat="server" ForeColor="Red"></asp:Label>
                    <asp:Button runat="server" Text="Button 1" ID="button1" />
                    <asp:DropDownList runat="server" ID="dropList1">
                        <asp:ListItem>Item 1</asp:ListItem>
                        <asp:ListItem>Item 2</asp:ListItem>
                    </asp:DropDownList>
                    <asp:UpdatePanel runat="server" ID="panel1_1" UpdateMode="Conditional">
                        <ContentTemplate>
                            <div style="margin-left: 50px">
                                Update Panel 1_1<br />
                                <asp:Label ID="timerLiteral1_1" runat="server" ForeColor="Red"></asp:Label>
                                <asp:Button runat="server" Text="Button 1_1" ID="button1_1" />
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </asp:Panel>
            </ContentTemplate>
            <%--<Triggers>
                <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
            </Triggers>--%>
        </asp:UpdatePanel>
        <asp:UpdatePanel runat="server" ID="UpdatePanel2" ChildrenAsTriggers="False" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="button0" EventName="Click" />
            </Triggers>
            <ContentTemplate>
                <asp:Panel runat="server" ID="panel2" BorderStyle="Dotted">
                    Update Panel 2<br />
                    <asp:Label ID="timerLiteral2" runat="server" ForeColor="Red"></asp:Label>
                    <asp:Button runat="server" Text="Button 2" ID="button2" />
                </asp:Panel>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
